package com.dly.hope.service.impl;

import com.dly.hope.dao.RoleDao;
import com.dly.hope.repository.RoleRepository;
import com.dly.hope.vo.RoleShow;
import com.dly.hope.pageUtils.PageRo;
import com.dly.hope.service.RoleService;
import com.dly.hope.pageUtils.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RoleServiceImpl implements RoleService {

    @Resource
    private RoleDao roleDao;

    @Resource
    private RoleRepository roleRepository;

    @Override
    public Page<RoleShow> getAll(PageRo pageRo) {
        Page<RoleShow> allRole = roleDao.getAllRole(pageRo);
        int size =  roleRepository.findAll().size();
        allRole.setCount(size);
        return allRole;
    }
}
